﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase

@if (Visible)
{
    <FluentStack Orientation="Orientation.Horizontal"
                 VerticalAlignment="VerticalAlignment.Top"
                 Style="@StyleValue"
                 Class="@ClassValue"
                 Id="@Id">
        <div style="width: 100%;">
            @if (@ChildContent == null && Dialog.Instance?.Parameters?.ShowTitle == true)
            {
                <FluentLabel Typo="Typography.PaneHeader">@Dialog.Instance?.Parameters?.Title</FluentLabel>
            }
            else
            {
                @ChildContent
            }
        </div>

        @if (ShowDismiss == true)
        {
            <FluentButton Id="dialog_close" Appearance="Appearance.Stealth" OnClick="@(() => Dialog.CancelAsync())" aria-label="@Dialog.Instance?.Parameters?.DismissTitle">
                <FluentIcon Value="@(new CoreIcons.Regular.Size20.Dismiss())" Width="20px" Color="Color.Neutral"  />
            </FluentButton>
            <FluentTooltip Anchor="dialog_close" Placement="Placement.Bottom">@Dialog.Instance?.Parameters?.DismissTitle</FluentTooltip>
        }
    </FluentStack>
}
